import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:it_cat/Tools/tools_base_page.dart';

class HomeNativePage extends CatBaseWidgetPage {
  @override
  _HomeNativePageState getState() => _HomeNativePageState();
}

class _HomeNativePageState extends CatBaseWidgetPageState<HomeNativePage> {
  @override
  Widget buildWidget(BuildContext context) {

    return RaisedButton(
      child: const Text('Open native page'),
      onPressed: () {
        print('open natve page!');
        Map<String,dynamic> tmp = {'color':'绿色'};
        FlutterBoost.singleton
            .open('native',urlParams: tmp)
            .then((Map<dynamic, dynamic> value) {
          print(
              'call me when page is finished. did recieve native route result $value');
        });
      },
    );
  }

}
